<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a>除已认证列表</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Indexadmin/index')}" style='line-height: 46px;'>
			手机号码： 
			<input type="text" name="mobile" style="width: 150px;" value="{:I('request.mobile')}" placeholder="请输入手机号码">
			姓名： 
			<input type="text" name="name" style="width: 150px;" value="{:I('request.name')}" placeholder="姓名">
			身份证：<input type="text" name="identity" style="width: 150px;" value="{:I('request.identity')}" placeholder="身份证">
			注册日期：<input class="js-date" type="text" name="starts" style="width: 150px;" value="{:I('request.starts')}" placeholder="起始时间">
			<input class="js-date" type="text" name="ends" style="width: 150px;" value="{:I('request.ends')}" placeholder="结束时间">
			<br />
			资料审核状态：<select name="type">
				<option value="">全部</option>
				<php>$tpl_selected=I('request.type')=='0'?"selected":"";</php>
				<option {$tpl_selected} value="0">待绑卡</option>
				<php>$tpl_selected=I('request.type')=='1'?"selected":"";</php>
				<option {$tpl_selected} value="1">上传证件照</option>
				<php>$tpl_selected=I('request.type')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">待审核</option>
				<php>$tpl_selected=I('request.type')=='3'?"selected":"";</php>
				<option {$tpl_selected} value="3">学信认证</option>
				<php>$tpl_selected=I('request.type')=='4'?"selected":"";</php>
				<option {$tpl_selected} value="4">填写联系信息</option>
				<php>$tpl_selected=I('request.type')=='5'?"selected":"";</php>
				<option {$tpl_selected} value="5">信息填写完成</option>
				<php>$tpl_selected=I('request.type')=='8'?"selected":"";</php>
				<option {$tpl_selected} value="8">系统审核不通过</option>
			</select>
			借款状态：<select name="type_borr">
				<option value="">全部</option>
				<php>$tpl_selected=I('request.type_borr')=='0'?"selected":"";</php>
				<option {$tpl_selected} value="0">待申请借款</option>
				<php>$tpl_selected=I('request.type_borr')=='1'?"selected":"";</php>
				<option {$tpl_selected} value="1">待填写运营商信息</option>
				<php>$tpl_selected=I('request.type_borr')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">借款中</option>
				<php>$tpl_selected=I('request.type_borr')=='3'?"selected":"";</php>
				<option {$tpl_selected} value="3">不通过</option>
			</select>
			认领状态：<select name="byusers">
				<php>$tpl_selected=I('request.byusers')=='3'?"selected":"";</php>
				<option {$tpl_selected} value="3">全部</option>
				<php>$tpl_selected=I('request.byusers')=='1'?"selected":"";</php>
				<php>$tpl_selected=I('request.byusers')==''?"selected":$tpl_selected;</php>
				<option {$tpl_selected} value="1">未认领</option>
				<php>$tpl_selected=I('request.byusers')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">已认领</option>
			</select>
			回流状态：<select name="reflux_status">
				<php>$tpl_selected=I('request.reflux_status')=='3'?"selected":"";</php>
				<php>$tpl_selected=I('request.reflux_status')==''?"selected":$tpl_selected;</php>
				<option {$tpl_selected} value="3">全部</option>
				<php>$tpl_selected=I('request.reflux_status')=='1'?"selected":"";</php>
				<option {$tpl_selected} value="1">正常用户</option>
				<php>$tpl_selected=I('request.reflux_status')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">回流客户</option>
			</select>
			<br/>
			<php>$group=get_groups_admin_user();</php>
			分销状态：<select name="is_dis">
				<php>$tpl_selected=I('request.is_dis')=='3'?"selected":"";</php>
				<option {$tpl_selected} value="3">全部</option>
				<php>$tpl_selected=I('request.is_dis')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">推广客户</option>
				<php>$tpl_selected=I('request.is_dis')=='1'?"selected":"";</php>
				<php>$tpl_selected=I('request.is_dis')==''?"selected":$tpl_selected;</php>
				<option {$tpl_selected} value="1">正常用户</option>
			</select>
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:U('Indexadmin/index')}">清空</a>
			<br/>
			<button class="btn btn-primary js-ajax-submit" type="button" id='add_bate' data-action="{:U('indexadmin/bate_add')}" onclick='check(1)' >批量认领</button>
			<button class="btn btn-primary js-ajax-submit" type="button" id='add_bate2' data-action="{:U('indexadmin/batch_add_reflux_user')}" onclick='check(2)' >批量添加回流用户</button>
			<a class="btn btn-primary" id='export_btn' href="{:U('indexadmin/export_app_user',array('wheres'=>$wheres_str))}" >导出</a>
			
			<if condition="($group eq 1 || $group eq 8 || $group eq 10)">
			<button class="btn btn-primary js-ajax-trf" type="button" id='trf_bate' data-action="{:U('indexadmin/transfer')}" onclick='trf()' >转让</button>
			</if>
		</form>
		<form method="post" class="js-ajax-form">
			<table class="table table-hover table-bordered" id='tab_check'>
				<thead>
					<tr>
					
						<th style='min-width: 30px;' align="center">选择</th>
						
						<th style='width: 66px;'>{:L('REGISTRATION_TIME')}</th>
						
						<th style='min-width: 50px;'>{:L('NICENAME')}</th>
						<th style='min-width: 60px;'>{:L('USER_INFO')}</th>
						<th style='min-width: 50px;'>{:L('LOAN_INFO')}</th>
						<th style='min-width: 50px;'>{:L('IDENTITY')}</th>
						<!-- <th style='min-width: 50px;'>{:L('LAST_LOGIN_TIME')}</th> -->
						<th style='min-width: 50px;'>负责专员</th>
						<th style='min-width: 50px;'>手机</th>
						
						<th style='width: 35px;'>学历</th>
						
						<!-- <th style='min-width: 50px;'>实名认证状态</th> -->
						<th style='min-width: 50px;'>资料认证状态</th>
						<th style='min-width: 50px;'>分销类型</th>
						<th>渠道来源</th>
						<th>推荐码</th>
						<th>回流状态</th>
						<th  style='min-width: 50px;' align="center">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<php>$user_statuses=array("0"=>L('USER_STATUS_BLOCKED'),"1"=>L('USER_STATUS_ACTIVATED'),"2"=>L('USER_STATUS_UNVERIFIED'));</php>
					<foreach name="list" item="vo">
					<tr>
						<td><input type='checkbox' name='id[]' value='{$vo.id}'/></td>
						<td>{$vo.crtime}</td>
						<td>{$vo['name']?$vo['name']:L('NOT_FILLED')}</td>
						<td>
							<if condition="($vo.type eq 0)"> 待绑卡
							<elseif condition="$vo.type eq 1"/>上传证件照
							<elseif condition="$vo.type eq 2"/>待审核
							<elseif condition="$vo.type eq 3"/>学信认证
							<elseif condition="$vo.type eq 4"/>填写联系信息
							<elseif condition="$vo.type eq 5" /> 信息填写完成
							<elseif condition="$vo.type eq 8" />系统审核不通过
							</if></td>
						<td><if condition="($vo.type_borr eq 0)">待申请借款
							<elseif condition="$vo.type_borr eq 1"/>待填写运营商
							<elseif condition="$vo.type_borr eq 2"/>借款中
							<elseif condition="$vo.type_borr eq 3"/>审核不通过
							<elseif condition="$vo.type_borr eq 4"/>已提额待激活
							</if></td>
						<if condition="($group eq 6)">
						<td>{$vo['identity']}</td>
						<else/>
						<php>$iden=substr($vo['identity'],6,8)</php>
						<td>{$iden}</td>
						</if>
						<!-- <td>{$vo.last_login_time}</td> -->
						<td>{$buyers[$vo['byusers']]}</td>
						<td>{$vo['photo_type']==1?'苹果':'安卓'}</td>
						<td>{$vo.education}</td>
						<php>$ds=array('0'=>'<span style="color:red">未认证</span>','1'=>'<span style="color:green">已认证</span>','2'=>'<span style="color:red">认证未通过</span>','3'=>'<span style="color:red">暂时不需要</span>')</php>
						<!-- <td>{$ds[$vo['silver_stutas']]}</td> -->
						<td>{$ds[$vo['account_status']]}</td>
						<!-- <td>{$user_statuses[$vo['user_status']]}</td> -->
						<td>{$vo['is_dis']==1?'推广':'正常'}</td>
						<td>{$codes[$vo['code']]|default=''}</td>
						<td>{$is_dis[$vo['id']]}</td>
						<td>
							<switch name="vo['reflux_status']">
								<case value="1">正常</case>
								<case value="2">审核成功</case>
								<default />回流用户
							</switch>
						</td>
						<td align="center">
							<if condition="($group eq 6 || $group eq 8 || $group eq 10 || $group eq 3)">
								<if condition="($vo['byusers'] neq 0)">
									 <if condition="($group neq 6)">
										<neq name="vo.account_status" value="1">
											<if condition="($vo.silver_stutas eq 0) or ($vo.silver_stutas eq 2)">
											<!-- <br />|<a href="{:U('indexadmin/examine',array('id'=>$vo['id']))}">实名认证</a> -->
											</if>
											<if condition="($vo.silver_stutas eq 1)">
											
											</if>
											<a href="{:U('indexadmin/see',array('id'=>$vo['id']))}">客户详情</a>
											|<a href="{:U('indexadmin/info',array('id'=>$vo['id']))}" >{:L('MOD')}</a>
											<br />|<a href="{:U('indexadmin/contact_exam',array('id'=>$vo['id']))}">资料认证审核</a>
										</neq>
										<eq name="vo.type" value="8">
											<br />|<a class="js-ajax-dialog-btn" data-msg="确定 {$vo['name']} 跳过系统认证?" href="{:U('indexadmin/type_exam',array('id'=>$vo['id']))}">跳过系统认证</a>					
										</eq>
										<eq name="vo.type" value="5">
											<if condition="($vo.type_borr eq 1)">
											<br />|<a href="{:U('indexadmin/jum_ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="确定 {$vo['name']} 跳过运营商验证?">跳过运营商验证</a>
											</if>
										</eq>
									</if>
								</if>
							<else/>
								<a href="{:U('indexadmin/see',array('id'=>$vo['id'],'from_type'=>1))}">客户详情</a>
								 <if condition="($group neq 6)">
									|<a href="{:U('indexadmin/info',array('id'=>$vo['id']))}" >{:L('MOD')}</a>
									<eq name="vo.account_status" value="0">
										<if condition="($vo.silver_stutas eq 0) or ($vo.silver_stutas eq 2)">
										<!-- <br />|<a href="{:U('indexadmin/examine',array('id'=>$vo['id']))}">实名认证</a> -->
										</if>
										<if condition="($vo.silver_stutas eq 1)">
										
										</if>
										<br />|<a href="{:U('indexadmin/contact_exam',array('id'=>$vo['id']))}">资料认证审核</a>
									</eq>
									<if condition="($vo.type_borr eq 1) and ($vo.byusers neq 0)" >
											<br />|<a class="js-ajax-dialog-btn" data-msg="确定 {$vo['name']} 跳过系统认证?" href="{:U('indexadmin/type_exam',array('id'=>$vo['id']))}">跳过系统认证</a>				
									</if>
									<eq name="vo.type" value="5">
										<if condition="($vo.type_borr eq 1)">
										<br />|<a href="{:U('indexadmin/jum_ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="确定 {$vo['name']} 跳过运营商验证?">跳过运营商验证</a>
										</if>
									</eq>
								</if>
							</if>
						</td>
					</tr>
					</foreach>
				</tbody>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<div id="dialog" style='display:none' >
	  <p>请选择转让的审核专员</p>
	  <ul style='width: 500px;list-style-type:none;'>
		<php>$i=0;</php>
		<foreach name="shen_user" item="vo">
		<li style='width: 110px;float: left;'><input type="radio" name='us_id' value='{$vo.id}' style='margin: 0 0 0 10px;'/>{$vo.user_login}</li>
		<php>$i++;</php>
		<if condition="($i eq 4)"><br/>
		<php>$i=0;</php>
		</if>
		</foreach>
	  </ul>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
	function check(type){
        	var btn;
	    	if(1==type){
	    	    btn = $('button.js-ajax-submit').eq(0);
			}else if(2==type){
	    	    btn = $('button.js-ajax-submit').eq(1);
			}
			form = $('form.js-ajax-form');
			var obj=document.getElementsByName('id[]'); 
			var s=0; 
			for(var i=0; i<obj.length; i++){ 
				if(obj[i].checked) s+=1; 
			}
			if(s==0){
				alert('请选择客户');
				return ;
			}
			form.ajaxSubmit({
	                url: type ? btn.data('action') : form.attr('action'),
	                //按钮上是否自定义提交地址(多按钮情况)
	                dataType: 'json',
	                beforeSubmit: function (arr, $form, options) {
						var tx='批量添加';
	                    //按钮文案、状态修改
	                    btn.text(tx + '中...').attr('disabled', true).addClass('disabled');
	                },
	                success: function (data, statusText, xhr, $form) {
	                    //按钮文案、状态修改
	                    btn.removeClass('disabled').parent().find('span').remove();
	
	                    if (data.state === 'success') {
	                        $('<span class="tips_success">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('slow').delay(1000).fadeOut(function () {
	                            if (data.referer) {
	                                //返回带跳转地址
	                                if (window.parent.art) {
	                                    //iframe弹出页
	                                    window.parent.location.href = data.referer;
	                                } else {
	                                    window.location.href = data.referer;
	                                }
	                            } else {
	                                if (window.parent.art) {
	                                    if(1==type){
	                                        reloadPage(window.parent);
										}else if(2==type){
	                                        window.location.reload();
										}
	                                } else {
	                                    //刷新当前页
	                                    reloadPage(window);
	                                }
	                            }
	                        });
	                    } else if (data.state === 'fail') {
	                        $('<span class="tips_error">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('fast');
	                        btn.removeProp('disabled').removeClass('disabled');
	                    }
	                }
	            });
	}
	function trf(){
		var btn = $('#trf_bate');
		form = $('form.js-ajax-form');
		var obj=document.getElementsByName('id[]'); 
		var s=''; 
		for(var i=0; i<obj.length; i++){ 
			if(obj[i].checked){
				if(s==''){
					s=obj[i].value;
				}else{
					s+=','+obj[i].value;
				}
				
			}
		}
		if(s==''){
			alert('请选择客户');
			return ;
		}
		href = btn.data('action'),
		href = href ? href : $this.attr('href');
		Wind.use('artDialog', function () {
		//document.getElementById("dialog").style.display='block';
			 art.dialog({
				title: false,
				//icon: 'question',
				content: $("#dialog").html(),
				//content: '1111',
				follow: document.getElementById('trf_bate'),
				close: function () {
					return true;
				},
				ok: function () {
					var radio = document.getElementsByName("us_id"); 
					var us_id=0;
					for (i=0; i<radio.length; i++) {  
						if (radio[i].checked) {  
							us_id=radio[i].value;
						}  
					}
					if(us_id==0){
						alert('请选择审核专员');
						return false;
					}
					$.ajax({
							url:href,
							type:'post',
							dataType:'json',
							data:'users='+s+'&us_id='+us_id,
							success:function(map){
								if (map.state == 'success') {
											art.dialog({
											content: map.info,
											icon: 'success',
											ok: function () {
												this.title(map.info);
												return true;
											}
										});
								} else if (map.state == 'fail') {
									//art.dialog.alert(data.info);
									//alert(data.info);//暂时处理方案
									art.dialog({
										content: map.info,
										icon: 'warning',
										ok: function () {
											this.title(map.info);
											return true;
										}
									});
								}
							}
								
					}); 
				},
				cancelVal: '关闭',
				cancel: true
			});
		});
		
	}
	</script>
</body>
</html>